<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    var arr = [7,6,5,2,3,4];
    console.log(arr);
    // 冒泡排序
    for(var i =0 ;i < arr.length-1;i++){
        for(var j = 0;j < arr.length - 1 -i;j++){
            if(arr[j]>arr[j+1]){
                var x = arr [j]
                arr[j] = arr[j+1]
                arr[j+1] = x
            }
        }
    }



    console.log(arr);
</script>
</html>